package uk.dier.account.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import uk.dier.account.dao.ISMarketDao;
import uk.dier.account.dto.MarketDto;
import uk.dier.account.entity.Market;
import uk.dier.account.exception.ExceptionDao;
import uk.dier.account.exception.ExceptionService;
import uk.dier.account.service.ISMarketService;

@Service
public class MarketSerciveImpl implements ISMarketService {

	@Autowired
	private ISMarketDao marketDao;
	
	public void saveMarket(Market newMarket) throws ExceptionService, ExceptionDao{
		marketDao.saveMarket(newMarket);
	}

	public void deleteMarket(Market removeMarket) throws ExceptionService, ExceptionDao{
		marketDao.deleteMarket(removeMarket);
	}

	public void updateMarket(Market updateMarket) throws ExceptionService, ExceptionDao {
		marketDao.updateMarket(updateMarket);
	}

	public List<MarketDto> findMarketByName(Market market) throws ExceptionService, ExceptionDao{
		return marketDao.findMarketByName(market);
	}

	public void setMarketDao(ISMarketDao marketDao) {
		this.marketDao = marketDao;
	}

}
